package com.muyun.data.modeler.core;

import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;

public class DatabaseAdminFactory {

    private ServiceLoader<IDatabaseAdmin> databaseAdmins;

    public DatabaseAdminFactory(){
        databaseAdmins = ServiceLoader.load(IDatabaseAdmin.class);
    }


    /**
     * 返回系统支持的数据库管理器
     *
     * @return
     */
    public List<IDatabaseAdmin> supports(){
        List<IDatabaseAdmin> databaseAdmins = new ArrayList<IDatabaseAdmin>();
        databaseAdmins.forEach(e->{
            databaseAdmins.add(e);
        });
        return databaseAdmins;
    }
}
